<template>
  <el-tabs type="border-card">
    <el-tab-pane :label="$t('reportModule.loanDate.numberTitle')">
      <number-data :all-package-data="allPackageData" />
    </el-tab-pane>
    <el-tab-pane :label="$t('reportModule.loanDate.amountTitle')">
      <amount-data :all-package-data="allPackageData" />
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import AmountData from './vtgLoanDate/amount'
import NumberData from './vtgLoanDate/number'
import { allPackage } from '@/api/user'
export default {
  name: 'VtgLoanDate',
  components: {
    AmountData,
    NumberData
  },
  data() {
    return {
      allPackageData: []
    }
  },
  mounted() {
    this.getAllPackage()
  },
  methods: {
    getAllPackage() {
      allPackage()
        .then(res => {
          if (res.success) {
            this.allPackageData = res.data
          } else {
            this.$message.error(res.message)
          }
        })
        .catch(err => {
          this.$message.error(err.message)
        })
    }
  }
}
</script>

<style lang="scss" scoped>
.el-tabs{
  margin: 10px;
}
</style>
